﻿<div [@routerTransition] id="Backlog">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>我的流程</span>
                </h3>
                <span class="m-section__sub">
                    我发起的流程列表
                </span>
            </div>

        </div>
    </div>

    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <div class="input-group margin-bottom-10">
                    <input autoFocus [(ngModel)]="filterText" name="filterText" class="form-control" placeholder="{{'SearchWithThreeDot' | localize}}" type="text">
                    <span class="input-group-btn">
                                <button class="btn btn-primary" type="submit"><i class="flaticon-search-1" [attr.aria-label]="l('Search')"></i></button>
                            </span>
                </div>
                <div class="row align-items-center">
                    <!--<Primeng-TurboTable-Start>-->
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable (onLazyLoad)="getPoccessWorkflow($event)" [value]="getWorkflowInstancePoccessViewDtos" rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true" [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="true">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 60px" pSortableColumn="emailAddress">
                                        操作        
                                    </th>
                                    <th style="width: 30px">
                                        ID                                       
                                    </th>
                                    <th style="width: 150px" pSortableColumn="name">
                                        流程名
                                        <p-sortIcon field="name"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px" pSortableColumn="name">
                                        流程状态
                                        <p-sortIcon field="name"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px" pSortableColumn="surname">
                                        发起日期
                                        <p-sortIcon field="surname"></p-sortIcon>
                                    </th>
                                    <th style="width: 150px">
                                        步骤名
                                    </th>
                                    <th style="width: 150px" pSortableColumn="emailAddress">
                                        处理人
                                    </th>
                                    <th style="width: 150px" pSortableColumn="emailAddress">
                                        接收日期
                                    </th>
                                   
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                        <td style="width: 60px">                                                   
                                                <div class="btn-group dropdown" dropdown>
                                                        <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                            <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                                        </button>
                                                        <ul class="dropdown-menu" *dropdownMenu  style="z-index:9999">
                                                            <li >
                                                              <a href="javascript:;"
                                                                           (click)="editEditionModal.show(record.id)">暂停</a>
                                                                    </li>
                                                            <li>
                                                                <a href="javascript:;"
                                                                   (click)="editEditionModal.show(record.id)">恢复</a>
                                                            </li>
            
                                                            <li>
                                                                <a href="javascript:;" 
                                                                   (click)="deleteEdition(getWorkflowInstancePoccessViewDtos)">取消</a>
                                                            </li>
            
                                                        </ul>
                                                    </div>
                                    </td>
                                    <td style="width: 30px">
                                         {{record.sortId}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="m--font-boldest"> {{record.workflowDefinitionId}}</span>
                                    </td>
                                    <td style="width: 150px" [ngSwitch]="record.status">
                                        <span class="m-badge m-badge--focus m-badge--wide" *ngSwitchCase="0"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">进行</font></font></span>
                                        <span class="m-badge m-badge--focus m-badge--warning" *ngSwitchCase="1"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">暂停</font></font></span>         
                                        <span class="m-badge m-badge--focus m-badge--success" *ngSwitchCase="2"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">完成</font></font></span>
                                        <span class="m-badge m-badge--focus m-badge--danger" *ngSwitchCase="3"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">取消</font></font></span>
                                    </td>
                                    <td style="width: 150px">
                                        {{record.createTime | date:'short' }}
                                    </td>
                                    <td style="width: 150px">
                                            <div [ngSwitch]="record.currentStepName">
                                                    <div *ngSwitchCase="">
                                                        <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                                                    </div>
                                                    <div *ngSwitchDefault>
                                                            <span class="m--font-bold"> {{record.currentStepName}}</span>
                                                    </div>
                                                </div>                                        
                                    </td>
                                    <td style="width: 150px">
                                        <div [ngSwitch]="record.currentStepUserName">
                                            <div *ngSwitchCase="">
                                                <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                                            </div>
                                            <div *ngSwitchDefault>
                                                <h6>
                                                    <font style="vertical-align: inherit;">
                                                       
                                                        <span class="m--font-bold"> {{record.currentStepUserName}}</span>
                                                    </font><br>
                                                </h6>
                                                <h6>
                                                    <span class="m--font-metal"><font style="vertical-align: inherit;">
                                                        {{record.currentStepUserId}}， {{record.currentStepUserOuName}}
                                                                </font></span>
                                                </h6>
                                            </div>
                                        </div>
                                    </td>
                                    <td style="width: 150px">
                                            <div [ngSwitch]="record.receivedStepTimeInterval">
                                                    <div *ngSwitchCase="">
                                                        <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                                                    </div>
                                                    <div *ngSwitchDefault>
                                                            <span class="m--font-bold"> {{record.receivedStepTimeInterval}}</span>
                                                    </div>
                                                </div>
                                        
                                    </td>
                                  
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                            {{'NoData' | localize}}
                        </div>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator (onPageChange)="getUsers($event)" [totalRecords]="primengTableHelper.totalRecordsCount" [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                    <!--<Primeng-TurboTable-End>-->
                </div>
            </div>
        </div>
    </div>
</div>